﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class TableCollectionExtensions
    {
        public static bool Exists(this TableCollection tableCollection, string tableIdOrNameOrValueorClass, bool extension = true)
        {
            return tableCollection.Exists(Find.ById(tableIdOrNameOrValueorClass)) ||
                tableCollection.Exists(Find.ByName(tableIdOrNameOrValueorClass)) ||
                tableCollection.Exists(Find.ByValue(tableIdOrNameOrValueorClass)) ||
                tableCollection.Exists(Find.ByClass(tableIdOrNameOrValueorClass)) ||
                tableCollection.Exists(Find.ByLabelText(tableIdOrNameOrValueorClass));
        }
    }
}